<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./Promise.js?a=1"></script>
    <script>
        // 1- 中断Promise链
        new Promise(function(resolve,reject){
            setTimeout(()=>{
                resolve(100);
            })
        }).then(value=>{
            console.log(value);// 100
            return value+1;
        }).then(value=>{
            console.log(value);// 101
            // 如果返回的是一个状态为pending的promise会中断promise
            return new Promise(()=>{})
        }).then(value=>{
            console.log(value);// 102
            return value+1;
        }).then(value=>{
            console.log(value);// 103
            return value+1;
        }).catch(reason=>{
            console.log(reason);// 异常
        })
    </script>
</body>
</html>